package com.lzlearn.service.impl;

import com.lzlearn.model.User;
import com.lzlearn.service.MyService;
import org.springframework.stereotype.Component;


public class MyServiceImpl implements MyService {
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public MyServiceImpl(String name) {
        System.out.println("MyServiceImpl被创建");
        System.out.println("注入name属性值为:"+name);
        this.name = name;
    }

    public MyServiceImpl() {
        System.out.println("MyServiceImpl被创建");
    }

    @Override
    public User selectUser() {
        System.out.println("selectUser方法被调用");
        return new User("张三","男");
    }
}
